package com.lc.hongtai.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.hongtai.R;
import com.lc.hongtai.conn.JsonInvest;
import com.lc.hongtai.progress.SaundProgressBar;

import java.util.List;

/**
 * Created by Administrator on 2/22/2016.
 */
public class NewsPersonAdapter extends BaseQuickAdapter<JsonInvest.Info.ListContent,BaseViewHolder> {


    public NewsPersonAdapter(List<JsonInvest.Info.ListContent> data) {
        super(R.layout.list_invest_financial, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, JsonInvest.Info.ListContent item) {
        helper.setText(R.id.tv_name,item.borrow_name);
        helper.setText(R.id.tv_sumMoney,item.need);
        helper.setText(R.id.tv_rate,"年化率  " + item.borrow_interest_rate + "%");
        helper.setText(R.id.tv_time,"期限  " + item.borrow_duration +item.borrow_duration_cn);


        SaundProgressBar mPbar;
      /*  helper.setProgress()


        holder.mPbar.setMax(100);

        Drawable indicator = getResources().getDrawable(
                R.mipmap.jindu4);
        Rect bounds = new Rect(0, 0, indicator.getIntrinsicWidth(),
                indicator.getIntrinsicHeight());
        indicator.setBounds(bounds);

        holder.mPbar.setProgressIndicator(indicator);

        holder.mPbar.setVisibility(View.VISIBLE);


        //holder.mPbar.setProgress(59 + 1);
        String string = list.get(position).progress;
        holder.mPbar.setmText(string);

//        holder.mPbar.setProgress(Integer.parseInt(list.get(position).progress));
        String newStr = list.get(position).progress;
        Double db = Double.valueOf(newStr);
        int a = db.intValue();
//       holder.mPbar.setProgress(a);
        holder.mPbar.setProgress(a);*/

    }
}
